<?xml version="1.0" encoding="UTF-8"?>
<project name="TfsIssueTracker" default="dist">

  <property file="build.properties"/>
  <property name="plugin.name" value="tfsissuetracker"/>
  <property name="javac2.home" value="${basedir}/lib-compile"/>

  <import file="tfsissuetracker.xml"/>
  <import file="teamcity-common.xml"/>

  <target name="package" depends="define.version">
    <package.teamcity.plugin name="${plugin.name}" server.output="${server.output.dir}"
                             plugin.descriptor.file="${basedir}/teamcity-plugin.xml"
                             plugin.version="${plugin.version}">
      
    </package.teamcity.plugin>
  </target>

  <target name="define.version" depends="define.version.if.under.teamcity">
    <tstamp>
      <format property="current.time" pattern="yyyyMMddHHmm"/>
    </tstamp>
    <property name="plugin.version" value="SNAPSHOT-${current.time}"/>
  </target>

  <target name="define.version.if.under.teamcity" if="build.number">
    <property name="plugin.version" value="${build.number}"/>
  </target>

  <target name="dist" depends="check.teamcitydistribution,all,package"/>

  <target name="clean" depends="tfsissuetracker.clean"/>

  <target name="deploy" depends="dist">
    <deploy.teamcity.plugin name="${plugin.name}"/>
  </target>

</project>